#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <signal.h>
#include <unistd.h>
#include <assert.h>
#include "../../src/thread.h"

void* func(void* arg){
  int i;
  for(i=1 ;i<1000000; i++){
    if(i%100000 == 0)
      printf("%d - %s\n",thread_self(),(char*)arg);
  }
  thread_exit(NULL);
}

int main(){
  thread_t tid1, tid2;
  assert(!thread_create(&tid1, func, "A"));
  assert(!thread_create(&tid2, func, "B"));
  assert(!thread_join(tid1, NULL));
  assert(!thread_join(tid2, NULL));
  return EXIT_SUCCESS;
}
